import React from 'react'
import { useContext } from 'react'
import { countContext} from "./A"
export default function C() {

    //3.  使用 useContext()  hook  使用上下文对象
    let [count,setCount] = useContext(countContext);
    
    //+1
    let add =()=>{
        setCount(count+1);
    }
    return (
        <div><h1>这是c组件:  {count}</h1>
            <button onClick={add}>+1111</button>
        </div>
    )
}
